<div class="email-form email-input email-formal-container">
  <form nz-form [formGroup]="emailSendForm" role="form">

    <nz-form-item>
      <nz-form-label nzFor="" nzRequired>发件人</nz-form-label>
      <nz-form-control>
        <input type="text" nz-input nzSize="default" formControlName="sender" autocomplete="off" placeholder="">
        <nz-form-explain *ngIf="!(emailSendForm.get('sender').valid || emailSendForm.get('sender').untouched)">
          <span class="text-danger" *ngIf="emailSendForm.get('sender').hasError('required')">请填写发件人!</span>
        </nz-form-explain>
      </nz-form-control>
    </nz-form-item>


    <nz-form-item>
      <nz-form-label nzFor="" nzRequired>收件人</nz-form-label>
      <nz-form-control>
        <nz-select  style="width: 100%" nzMode="multiple" nzAllowClear nzPlaceHolder="选择接收邮件的企业" [(ngModel)]="listOfSelectedValue" formControlName="receiver">
          <nz-option *ngFor="let option of listOfOption" [nzLabel]="option.name" [nzValue]="option.id"></nz-option>
        </nz-select>
        <nz-form-explain *ngIf="!(emailSendForm.get('receiver').valid || emailSendForm.get('receiver').untouched)">
          <span class="text-danger" *ngIf="emailSendForm.get('receiver').hasError('required')">请选择收件企业!</span>
        </nz-form-explain> 
      </nz-form-control>
    </nz-form-item>

   

    <nz-form-item>
      <nz-form-label nzFor="" nzRequired>主题</nz-form-label>
      <nz-form-control>
        <input type="text" nz-input nzSize="default" formControlName="theme" autocomplete="off" placeholder="">
        <nz-form-explain *ngIf="!(emailSendForm.get('theme').valid || emailSendForm.get('theme').untouched)">
          <span class="text-danger" *ngIf="emailSendForm.get('theme').hasError('required')">带*字段为必填项!</span>
        </nz-form-explain>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-label nzFor="" nzRequired>邮件内容</nz-form-label>
      <nz-form-control>
        <textarea rows="4" nz-input formControlName="emailContent"></textarea>
        <nz-form-explain *ngIf="!(emailSendForm.get('emailContent').valid || emailSendForm.get('emailContent').untouched)">
          <span class="text-danger" *ngIf="emailSendForm.get('emailContent').hasError('required')">带*字段为必填项!</span>
        </nz-form-explain>
      </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-control>
        <button nz-button nzType="primary" class="modal-footer-btn"
         (click)="sendEmail()" [disabled]="!emailSendForm.valid">确&nbsp;&nbsp;&nbsp;&nbsp;定</button>
      </nz-form-control>
    </nz-form-item>
  </form>
</div>
